<?php $this->load->view('common/head');?>
		<form class="form-horizontal margin-top-10" name="add" id="add" action="<?php echo $this->input->server('REQUEST_URI'); ?>" method="post">
		  <input type="hidden" name="id" id="id" value="<?=$offlineData['id']?>">
		  <input type="hidden" name="procId" id="procId" value="<?=$offlineData['procId']?>">
			<table class="table table-condensed table-bordered mb27" style="width: 800px; margin:0 auto;">
			  <tbody>
			    <tr>
			      <td class="bg-primary col-md-3" rowspan="2" width="10%">活动目标</td>	
			      <td class="bg-primary col-md-3" width="10%">集客目标</td>
			      <td width="80%"><?=(float)$offlineData['targetCustomer']?$offlineData['targetCustomer']:''?>
			      </td>
			    </tr>
			    <tr>
			      <td class="bg-primary col-md-3">订单目标</td>
			      <td><?=(float)$offlineData['targetOrder']?$offlineData['targetOrder']:''?>
			      </td>
			    </tr>
			    <tr>
			      <td class="bg-primary col-md-3" rowspan="2">实际达成</td>	
			      <td class="bg-primary col-md-3">集客效果</td>
			      <td>
			      <input type="number" required min="0" class="form-control" name="actualCustomer" id="actualCustomer" value="<?=(float)$offlineData['actualCustomer']?$offlineData['actualCustomer']:''?>" placeholder="集客效果">
			      </td>
			    </tr>
			    <tr>
			      <td class="bg-primary col-md-3">订单效果</td>
			      <td>
			      <input type="number" required min="0" class="form-control" name="actualOrder" id="actualOrder" value="<?=(float)$offlineData['actualOrder']?$offlineData['actualOrder']:''?>" placeholder="订单效果">
			      </td>
			    </tr>
			    <tr>
			      <td class="bg-primary col-md-3" colspan="2">结算申请费用</td>
			      <td>
			      <input type="number" required min="0" step="0.01" class="form-control" name="settleApply" id="settleApply" value="<?=(float)$offlineData['settleApply']?$offlineData['settleApply']:''?>" placeholder="结算申请费用">
			      </td>
			    </tr>
			    <tr>
			      <td class="bg-primary col-md-3" colspan="2">结算材料</td>
			      <td>
			      	<span id="settleUploadDownload">
		            <?php if ($onlineData['settleFileId']) {?>
		            <a type="button" class="btn btn-default" href="<?=printUrl('Upload','download',array('fileId'=>$onlineData['settleFileId']))?>" aria-label="Left Align" role="button">
		              <span class="glyphicon glyphicon-download-alt" aria-hidden="true"></span>
		              附件下载
		            </a>
		            <?php } ?>
		            </span>
		            <input type="hidden" id="settleUploadFileId" name="settleFileId" value="<?=$onlineData['settleFileId']?>" readonly="readonly">
	              	<input type="button" id="settleUpload" value="上传" /><br>
	              	(请上传压缩包格式)
			      </td>
			    </tr>
			    <!-- <tr>
			      <td class="bg-primary col-md-3" colspan="2">结算相片</td>
			      <td>
			    				      <input type="button" id="voucherButton" value="凭证上传" />
			      </td>
			    </tr>
			    <tr>
			    	<td colspan="2"><font color="red">可上传多张结算凭证（至少5张）</font></td>
			    	<td>
			    	  <ul id="voucherBox" style="width: 240px;">
			    	  	<?php if ($offlineData['voucher']): ?>
			    	  		<?php foreach ((array)$offlineData['voucher'] as $k => $v): ?>
			    					    	  	<li>
			    				    	  			<input type="hidden" name="voucher[]" id="voucher<?=$k?>" value="<?=$v['viewPath']?>">
			    				    	  			<a target="_blank" href="<?=$v['viewPath']?>" class="thumbnail" style="widht:200px; float:left;"><img class="carousel-inner img-responsive img-rounded" src="<?=$v['viewPath']?>"></a>
			    				    	  			<a class="voucherDelete" style="float:right;" href="javascript:void(0);">删除</a>
			    					    	  	</li>
			    	  		<?php endforeach ?>
			    	  	<?php endif ?>
			    	  </ul>
			    	</td>
			    </tr> -->
			    <tr>
			      <td colspan="3" align="center">
			    	<button type="submit" class="btn btn-default btn-primary">保存</button>
			  		<button type="button" onclick="closeWindow()" class="btn btn-default btn-primary">取消</button>
			      </td>
			    </tr>
			    </tbody>
			  </table>
		</form>
<script type="text/javascript">
$(function(){
  initValidation();
});
//初始化验证
function initValidation(){
	$('form[name="add"]').find("input,select,textarea").jqBootstrapValidation("destroy");
	$('form[name="add"]').find("input,select,textarea").not("[type=submit]").jqBootstrapValidation({
	    preventSubmit:false,
	    submitSuccess: function (form, event) {
	         event.preventDefault();
	         ajaxFormSubmit('add');
	     },
	     submitError: function (form, event, errors) {
	       event.preventDefault();
	       }
  	});
}
</script>
<?php initUploadButtons(array('settleUpload'), printUrl('Upload','uploadSave',array('dir'=>'settleFile')), 'imgFile'); ?>
<?php //initUeditorImages('voucher') ?>
<?php //initUploadMultiImage(array('voucher')); ?>
<?php $this->load->view('common/foot');?>